<?php
class Dashboard extends Admin_Controller{
	public function __construct(){
		parent::__construct();
	}	
	public function index(){
		$data['template']="admincp/dashboard/index";
		$data['title_page']='<i class="icon20 i-dashboard"></i> '.trans('title_dashboard');
		$this->breadcrumb->append_crumb(trans('breadcrumb_home'),admincp_url());
		$this->breadcrumb->append_crumb(trans('breadcrumb_dashboard'),base_url().'admincp/dashboard');
		$data['dateCurrent'] = date('Y-m-d');
		$data['analytics'] = $this->db->query('SELECT SUM(visits) as total, ROUND(((SUM(newVisits)/SUM(visits))*100)) as new, ROUND((((SUM(visits) - SUM(newVisits))/SUM(visits))*100)) as old FROM tpt_analytics')->row_array();
		$this->load->view("admincp/template",$data);
	}
}